package com.yb.xczx.cloud.content.controller;


import com.yb.xczx.cloud.content.service.ITeachplanService;
import com.yb.xczx.cloud.content.vo.AddTeachplanVo;
import com.yb.xczx.cloud.content.vo.TeachplanTreeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 课程计划 前端控制器
 * </p>
 *
 * @author 姚兵
 * @since 2023-05-07
 */
@RestController
@RequestMapping("/teachplan")
public class TeachplanController {

    @Autowired
    ITeachplanService teachplanService;

    @GetMapping("{courseId}/tree-nodes")
    public List<TeachplanTreeVo> treeNodes(@PathVariable Long courseId){
        return teachplanService.treeNodes(courseId);
    }

    @PostMapping("")

    public void teachPlan(@RequestBody AddTeachplanVo teachplanVo){
         teachplanService.add(teachplanVo);
    }
}
